﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;
using DTO;
namespace DAO
{
    public class RapDAO
    {
        public List<Rap> layDSRap()
        {
            List<Rap> dsRap = new List<Rap>();
            string sql = "Select * from RapChieu";
            SqlConnection cn = DataProvider.ConnectionData();
            SqlCommand cmd = new SqlCommand(sql, cn);
            SqlDataReader datar = cmd.ExecuteReader();
            while (datar.Read())
            {
                Rap r = new Rap();
                r.MaRap = datar["MaRap"].ToString();
                r.TenRap = datar["TenRap"].ToString();
                r.DiaChi = datar["DiaChi"].ToString();
                dsRap.Add(r);
            }
            return dsRap;
        }
    }
}
